<template>
  <div></div>
  <!-- <div :style="{ height: navBarHeight + 'px' }">
    <u-sticky>
      <u-navbar :title="props.title" :autoBack="true" :leftIconSize="showBack ? 20 : 0"> </u-navbar>
    </u-sticky>
  </div> -->
</template>

<script setup lang="ts">
import { onBeforeMount, onMounted, ref, watch } from "vue";
const navBarHeight = ref();
const data = ref();

const props = defineProps({
  // 列表内容
  title: {
    type: String,
    default: () => "",
  },
  className: {
    type: Object,
    default: () => {},
  },
  showBack: {
    type: Boolean,
    default: () => false,
  },
});

onBeforeMount(() => {
  data.value = uni.getStorageSync("navTitle");

  uni.setNavigationBarTitle({ title: props.title });
  uni.setNavigationBarColor({
    backgroundColor: data.value.backgroundColor ? data.value.backgroundColor.toLowerCase() : "#ffffff",
    frontColor: data.value.color ? data.value.color.toLowerCase() : "#000000",
  });

  // if (uni.canIUse("getMenuButtonBoundingClientRect")) {
  //   let sysInfo = uni.getSystemInfoSync();
  //   let rect = uni.getMenuButtonBoundingClientRect();
  //   navBarHeight.value = rect.bottom + 16 / sysInfo.pixelRatio;
  //   // 存储胶囊位置信息
  //   uni.setStorageSync("menuButtonRect", rect);
  //   // 存储自定义导航栏的高度
  //   uni.setStorageSync("navBarHeight", navBarHeight.value);
  // } else {
  //   uni.showToast({
  //     title: "您的微信版本过低，界面可能会显示不正常",
  //     icon: "none",
  //     duration: 4000,
  //   });
  // }
});
</script>

<style></style>
